API Documentation
Public Member Functions | List of all members
nkImages::Image Class Referencefinal

Holds all information required for an image, with ownership over the data. More...

Inheritance diagram for nkImages::Image:
nkImages::ImageBase

Public Member Functions

 Image ()
 
 Image (nkMemory::Buffer &&data)
 
 Image (nkMemory::Buffer &&data, unsigned int width, unsigned int height, PIXEL_FORMAT format)
 
 Image (nkMemory::Buffer &&data, unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelByteSize, unsigned int rowByteSize)
 
 Image (const Image &other)
 
 Image (Image &&other)
 
 ~Image ()
 
virtual unsigned char * getDataPtr () const override
 
const nkMemory::BuffergetData () const
 
Imageoperator= (const Image &other)
 
Imageoperator= (Image &&other)
 
- Public Member Functions inherited from nkImages::ImageBase
 ImageBase ()
 
 ImageBase (unsigned int width, unsigned int height, PIXEL_FORMAT format)
 
 ImageBase (unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelByteSize, unsigned int rowByteSize)
 
 ImageBase (const ImageBase &other)
 
 ImageBase (ImageBase &&other)
 
virtual ~ImageBase ()
 
unsigned int getWidth () const
 
unsigned int getHeight () const
 
unsigned int getDepth () const
 
PIXEL_FORMAT getFormat () const
 
unsigned int getPixelByteSize () const
 
unsigned int getRowByteSize () const
 
unsigned int getSliceByteSize () const
 
void setWidth (unsigned int value)
 
void setHeight (unsigned int value)
 
void setDepth (unsigned int value)
 
void setFormat (PIXEL_FORMAT value)
 
void setPixelByteSize (unsigned int value)
 
void setRowByteSize (unsigned int value)
 
void setSliceByteSize (unsigned int value)
 
nkMaths::Vector getPixel (unsigned int x, unsigned int y, unsigned int z=1)
 
ImageBaseoperator= (const ImageBase &other)
 
ImageBaseoperator= (ImageBase &&other)
 

Detailed Description

Holds all information required for an image, with ownership over the data.

See ImageBase for more information.

Constructor & Destructor Documentation

◆ Image() [1/6]

nkImages::Image::Image ( )

Default constructor.

◆ Image() [2/6]

nkImages::Image::Image ( nkMemory::Buffer &&  data)

Data-move constructor.

Parameters
dataThe buffer which data should be part of the image.

◆ Image() [3/6]

nkImages::Image::Image ( nkMemory::Buffer &&  data,
unsigned int  width,
unsigned int  height,
PIXEL_FORMAT  format 
)

Simple 2D image constructor.

Parameters
dataThe buffer which data should be part of the image.
widthThe width of the image, in pixels.
heightThe height of the image, in pixels.
formatThe format of the image.

◆ Image() [4/6]

nkImages::Image::Image ( nkMemory::Buffer &&  data,
unsigned int  width,
unsigned int  height,
unsigned int  depth,
PIXEL_FORMAT  format,
unsigned int  pixelByteSize,
unsigned int  rowByteSize 
)

Aligned 2D image constructor.

Parameters
dataThe buffer which data should be part of the image.
widthThe width of the image, in pixels.
heightThe height of the image, in pixels.
depthThe depth of the image, in number of slices of width * height images.
formatThe format of the image.
pixelByteSizeThe size of a pixel, in bytes.
rowByteSizeThe size of a row, in bytes.

◆ Image() [5/6]

nkImages::Image::Image ( const Image other)

Copy constructor. Will make a copy of the data.

Parameters
otherThe image to copy from.

◆ Image() [6/6]

nkImages::Image::Image ( Image &&  other)

Move constructor. Will move the data over.

Parameters
otherThe image to move.

◆ ~Image()

nkImages::Image::~Image ( )

Destructor.

Member Function Documentation

◆ getDataPtr()

virtual unsigned char* nkImages::Image::getDataPtr ( ) const
overridevirtual
Returns
A pointer over the image data.

Implements nkImages::ImageBase.

◆ getData()

const nkMemory::Buffer& nkImages::Image::getData ( ) const
Returns
A reference over the internal buffer holding the image data.

◆ operator=() [1/2]

Image& nkImages::Image::operator= ( const Image other)

Copy assignment operator.

Parameters
otherThe image to copy and assign.

◆ operator=() [2/2]

Image& nkImages::Image::operator= ( Image &&  other)

Move assignment operator.

Parameters
otherThe image to move and assign.

The documentation for this class was generated from the following file: